package com.andnnl.random;

import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Random;

/**
 * Created by chenss on 2022/1/5.
 */
public class RandomMobileTest {
    static Random random = new Random();
    static long startMobile = 13001010001L;
    static long startMobile2 = 13201010001L;

    public static void main(String[] args) {
        int nums=7;//生成多少W个号码
        //Get the file reference
        Path path = Paths.get("D:\\destop_file\\"+nums+"W_random.txt");
//        Path path = Paths.get("/Users/test/"+nums+"W_random.txt");

//Use try-with-resource to get auto-closeable writer instance
        try (BufferedWriter writer = Files.newBufferedWriter(path)) {
            for (int k = 0; k < nums*10000; k++) {
                String m=""+(startMobile + random.nextInt(1000000000));
                writer.write(m);
                writer.newLine();
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
